package com.dyw.springboot.config;

import com.dyw.springboot.entity.Car;
import com.dyw.springboot.entity.Cat;
import com.dyw.springboot.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;

/**
 * @author Devil
 * @create 2022-01-25-11:46
 */
@Import({Cat.class})
@ImportResource("classpath:Bean.xml")
@EnableConfigurationProperties(Car.class)
@Configuration(proxyBeanMethods = false)
public class Config {


}
//    @Bean
//    @ConditionalOnBean(Cat.class)
//    public User user(){
//        User user = new User();
//        user.setCat(cat());
//        return user;
//    }
//
//    @Bean("cat1")
//    public Cat cat(){
//        return new Cat();
//    }